<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

//后台登录页面的路由
Route::get('/admin/public/login','Admin\PublicController@login') -> name('login');
//登录表单的处理
Route::post('/admin/public/checkLogin','Admin\PublicController@checkLogin');
//退出路由
Route::get('/admin/public/logout','Admin\PublicController@logout');

//后台路由
Route::group(['prefix' => 'admin','middleware' => ['auth:admin','checkrbac']],function(){
	//展示后台首页页面
	Route::get('index/index','Admin\IndexController@index');
	Route::get('index/welcome','Admin\IndexController@welcome');

	//管理员管理模块相关的路由
	Route::get('admin/index','Admin\AdminController@index');//列表页面
	Route::any('admin/add','Admin\AdminController@add');//添加操作
	Route::get('admin/del','Admin\AdminController@del');//删除操作
	Route::any('admin/edit','Admin\AdminController@edit');//修改操作
	//针对管理员列表的服务端分页
	Route::get('admin/serverSide/{mark?}','Admin\AdminController@serverSide');

	//权限管理的操作
	Route::any('auth/add','Admin\AuthController@add');//添加权限
	Route::get('auth/index','Admin\AuthController@index');//权限列表

	//角色管理的操作
	Route::get('role/index','Admin\RoleController@index');//角色列表
	Route::any('role/assign','Admin\RoleController@assign');//角色权限分配

	//会员管理路由
	Route::get('member/index','Admin\MemberController@index');//列表页面
	Route::any('member/add','Admin\MemberController@add');//添加操作
	Route::get('member/del','Admin\MemberController@del');//删除操作
	Route::any('member/edit','Admin\MemberController@edit');//修改操作
	Route::get('member/getAreasByPid','Admin\MemberController@getAreasByPid');//ajax专用

	//文件上传
	Route::post('uploader/webuploader','Admin\UploaderController@webuploader');
	Route::post('uploader/qiniu','Admin\UploaderController@qiniu');//七牛专用

	//专业分类和专业管理
	Route::get('protype/index','Admin\ProtypeController@index');//专业分类列表
	Route::get('profession/index','Admin\ProfessionController@index');//专业列表
	Route::any('profession/add','Admin\ProfessionController@add');//专业添加

	//课程和点播的管理
	Route::get('course/index','Admin\CourseController@index');//课程列表
	Route::get('lession/index','Admin\LessionController@index');//课程点播列表
	Route::get('lession/play','Admin\LessionController@play');//课程点播播放

	//试卷和试题管理
	Route::get('paper/index','Admin\PaperController@index');//试卷列表
	Route::get('question/index','Admin\QuestionController@index');//试题列表
	Route::get('question/export','Admin\QuestionController@export');//导出
	Route::any('question/import','Admin\QuestionController@import');//导入

	//直播和直播流的管理
	Route::get('stream/index','Admin\StreamController@index');//流管理列表
	Route::any('stream/add','Admin\StreamController@add');//流的添加
	Route::get('live/index','Admin\LiveController@index');//直播课程的列表
});

//定义前台路由
Route::get('/','Home\IndexController@index');	//根路由

//直播观看路由
Route::get('/home/live','Home\LiveController@index');

//专业详情展示
Route::get('/home/profession','Home\ProfessionController@index');

//专业订单确认页面
Route::get('/home/makeOrder','Home\ProfessionController@makeOrder');

//使用微信付款
Route::get('/home/profession/pay','Home\ProfessionController@pay');